import React from "react";
import type { BaseButtonProps } from "antd/es/button/button";

interface Props {
  element: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
}

const CloneElement: React.FC<Props & BaseButtonProps> = (props) => {
  return <React.Fragment>{props.element && React.cloneElement(props.element, { ...props })}</React.Fragment>;
};

export default React.memo(CloneElement);
